import ownerModel from "../common/ownerModel";
import pagesModel from "../common/pagesModel";
import stat from "../common/stat";
import movieModel from "./movieModel";

export default class videoInfoModels {
  code: number;
  message: string;
  data: videoInfoModels;
  aid: string;
  attribute: string;
  copyRight: number;
  ctime?: number;
  desc: string;
  duration?: number;
  pic: string;
  pubdate?: number;
  state: number;
  title: string;
  tid: number;
  tname: string;
  redirect_url: string;
  owner: ownerModel;
  owner_ext: ownerExtModel;
  pages: Array<pagesModel>;
  relates: Array<relatesModel>;
  req_user: reqUserModel;
  rights: rightsModel;
  season: seasonModel;
  tag: Array<tagsModel>;
  stat: stat;
  movie: movieModel;
  elec: elecModel;
  audio: audioModel;
  staff: Array<staffModel>;
  subtitle: hasSubtitleModel;
  interaction: interactionModel;
}

export class staffModel {
  attention: number;
  face: string;
  name: string;
  title: string;
  mid: number;
  official_verify: officialVerify;
}

export class audioModel {
  cover_url: string;
  entrance: string;
  title: string;
  play_count: number;
  reply_count: number;
  song_id: number;
}

export class elecModel {
  count: number;
  elec_num: number;
  total: number;
  list: Array<elecModel>;
  avatar: string;
  pay_mid: string;
  rank: string;
  uname: string;
}

export class tagsModel {
  code: number;
  data: object;
  rid: number;
  tags: Array<tagsModel>;
  tag_id: number;
  tag_name: string;
  highlight: number;
  message: string;
}

export class seasonModel {
  season_id: string;
  cover: string;
  title: string;
  is_finish: number;
  episode_status: number;
  newest_ep_index: string;
  newest_ep_id: string;
  weekday: number;
  total_count?: number;

  get banText() {
    if (this.is_finish == 1) return `已完结,共${this.total_count}话`;
    else {
      let we = "";
      switch (this.weekday) {
        case 1:
          we = "一";
          break;
        case 2:
          we = "二";
          break;
        case 3:
          we = "三";
          break;
        case 4:
          we = "四";
          break;
        case 5:
          we = "五";
          break;
        case 6:
          we = "六";
          break;
        case 7:
          we = "七";
          break;
      }
      return `连载中,每周${we}更新`;
    }
  }
}

export class rightsModel {
  bp: number;
  download: number;
  elec: number;
  hd5: number;
  movie: number;
  pay: number;
}

export class reqUserModel {
  attention: number;
  favorite: number;
  like: number;
  coin: number;
}

export class relatesModel {
  aid: number;
  owner: relatesModel;
  name: string;
  title: string;
  pic: string;
  stat: relatesModel;
  danmaku: string;
  is_ad?: boolean;
  view: string;
}

export class ownerExtModel {
  official_verify: officialVerify;
  vip: vip;
  fans: number;
}

export class vip {
  vipType: number;
  vipStatus: number;
  vipDueDate: number;
}

export class officialVerify {
  desc: string;
  type: number;
}

export class interactionModel {
  graph_version: number;
  history_Node: history_nodeModel;
}

export class history_nodeModel {
  node_id: number;
  title: string;
  cid: number;
}

export class hasSubtitleModel {
  allow_submit: boolean;
  subtitles: Array<hasSubtitleItemModel>;
}

export class hasSubtitleItemModel {
  id: number;
  lan: string;
  lan_soc: string;
  subtitle_url: string;
}
